package a2022.a20220909;

/**
 * @author lenovo
 * @date 2022/9/9
 */
public class a {
    public static void main(String[] args) {
        System.out.println(minOperations(new String[]{"d1/", "d2/", "./", "d3/", "../", "d31/"}));
    }

    public static int minOperations(String[] logs) {
        int num = 0;
        for (int i = 0; i < logs.length; i++) {
            if (logs[i].equals("../")) {
               if (num >0) num--;
            } else if (logs[i].equals("./")) {
                num = num;
            } else  {
                num++;
            }
        }
        return num;
    }
}
